package me.weijing.common.util;

import android.content.Context;

import com.baidu.android.pushservice.PushConstants;
import com.baidu.android.pushservice.PushManager;
import com.baidu.android.pushservice.PushNotificationBuilder;

/**
 * 百度push管理类
 * 
 * @author jiayuan.luo 2013-5-31下午4:04:55
 * @version 1.0.0
 * @category 杭州尤拉夫科技有限公司(微警)
 */
public class PushServiceManager {
    /**
     * 通过api—key连接到百度push服务器
     * 
     * @param content
     */
    public static void startPush(Context content) {
        PushManager.startWork(content, PushConstants.LOGIN_TYPE_API_KEY, "Y1sTFhklMSQnRlQFFiGy7ScG");
    }

    /**
     * 停止push服务
     * 
     * @param content
     */
    public static void stopPush(Context content) {
        PushManager.stopWork(content);
    }

    /**
     * 重新连接百度push服务
     * 
     * @param content
     */
    public static void resumePush(Context content) {
        PushManager.resumeWork(content);
    }

    /**
     * 自定义通知栏
     * 
     * @param content
     * @param builder
     */
    public static void setNotification(Context content, PushNotificationBuilder builder) {
        PushManager.setNotificationBuilder(content, 1, builder);
    }
}
